import request from '@/config/axios'
import {PaymentBatchVO} from "@/api/dispatch/paymentbatch";

// 销售收款对账单 VO
export interface FinanceReceiptBatchVO {
  id: number // 订单编号
  receiptIds: string // 收款编号集合
  amount: number // 合计金额
  receiptAmount: number // 已收金额
  customerName: string // 客户
  remark: string // 备注
  status: number // 开启状态
  sort: number // 排序
}

// 销售收款对账单 API
export const FinanceReceiptBatchApi = {
  // 查询销售收款对账单分页
  getFinanceReceiptBatchPage: async (params: any) => {
    return await request.get({ url: `/erp/finance-receipt-batch/page`, params })
  },

  updateReceiptAmount: async (data) => {
    return await request.put({ url: `/erp/finance-receipt-batch/updateReceiptAmount`, data })
  },

  handleChangeRemark: async (data) => {
    return await request.put({ url: `/erp/finance-receipt-batch/handleChangeRemark`, data })
  },

  // 查询销售收款对账单详情
  getFinanceReceiptBatch: async (id: number) => {
    return await request.get({ url: `/erp/finance-receipt-batch/get?id=` + id })
  },

  // 新增销售收款对账单
  createFinanceReceiptBatch: async (data: FinanceReceiptBatchVO) => {
    return await request.post({ url: `/erp/finance-receipt-batch/create`, data })
  },

  // 修改销售收款对账单
  updateFinanceReceiptBatch: async (data: FinanceReceiptBatchVO) => {
    return await request.put({ url: `/erp/finance-receipt-batch/update`, data })
  },

  // 删除销售收款对账单
  deleteFinanceReceiptBatch: async (id: number) => {
    return await request.delete({ url: `/erp/finance-receipt-batch/delete?id=` + id })
  },

  // 导出销售收款对账单 Excel
  exportFinanceReceiptBatch: async (params) => {
    return await request.download({ url: `/erp/finance-receipt-batch/export-excel`, params })
  },
}
